#include<iostream>
#include "contacts.pb.h"
#include<string>
int main()
{
  contacts::contacts con;
  con.set_name("zhangsan");
  con.set_sn(10001);
//序列化
  std::string ret;
  con.SerializeToString(&ret);


  //反序列化
  contacts::contacts tem;
  tem.ParseFromString(ret);
  std::cout<<tem.name()<<std::endl;
  std::cout<<tem.sn()<<std::endl;
  return 0;
}
